package com.txts.road.admin.teamSys.service.impl;

import com.txts.road.admin.common.utils.DateUtils;
import com.txts.road.admin.teamSys.domain.TeamInfo;
import com.txts.road.admin.teamSys.mapper.TeamInfoMapper;
import com.txts.road.admin.teamSys.service.ITeamInfoService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 车队信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-19
 */
@Service
public class TeamInfoServiceImpl implements ITeamInfoService 
{
    @Resource
    private TeamInfoMapper teamInfoMapper;

    /**
     * 查询车队信息
     * 
     * @param teamId 车队信息主键
     * @return 车队信息
     */
    @Override
    public TeamInfo selectTeamInfoByTeamId(String teamId)
    {
        return teamInfoMapper.selectTeamInfoByTeamId(teamId);
    }

    /**
     * 查询车队信息列表
     * 
     * @param teamInfo 车队信息
     * @return 车队信息
     */
    @Override
    public List<TeamInfo> selectTeamInfoList(TeamInfo teamInfo)
    {
        return teamInfoMapper.selectTeamInfoList(teamInfo);
    }

    /**
     * 新增车队信息
     * 
     * @param teamInfo 车队信息
     * @return 结果
     */
    @Override
    public int insertTeamInfo(TeamInfo teamInfo)
    {
        teamInfo.setCreateTime(DateUtils.getNowDate());
        return teamInfoMapper.insertTeamInfo(teamInfo);
    }

    /**
     * 修改车队信息
     * 
     * @param teamInfo 车队信息
     * @return 结果
     */
    @Override
    public int updateTeamInfo(TeamInfo teamInfo)
    {
        teamInfo.setUpdateTime(DateUtils.getNowDate());
        return teamInfoMapper.updateTeamInfo(teamInfo);
    }

    /**
     * 批量删除车队信息
     * 
     * @param teamIds 需要删除的车队信息主键
     * @return 结果
     */
    @Override
    public int deleteTeamInfoByTeamIds(String[] teamIds)
    {
        return teamInfoMapper.deleteTeamInfoByTeamIds(teamIds);
    }

    /**
     * 删除车队信息信息
     * 
     * @param teamId 车队信息主键
     * @return 结果
     */
    @Override
    public int deleteTeamInfoByTeamId(String teamId)
    {
        return teamInfoMapper.deleteTeamInfoByTeamId(teamId);
    }
}
